<?php

class Application_Model_Subscribe
{	
	
	protected $_id;
	protected $_sender_id;
	protected $_sender_name;
	protected $_sender_tel;
	protected $_sender_addrid;
	protected $_recipient;
	protected $_rec_tel;
	protected $_rec_email;
	protected $_rec_addrid;
	protected $_barcodeid;
	protected $_sub_orderid;
	protected $_send_unitid;
	protected $_rec_unitid;
	protected $_send_courierid;
	protected $_rec_courierid;
	protected $_if_pay_now;
	protected $_pay_type;
	protected $_fee;
	protected $_sub_status;
	protected $_remark;
	protected $_size_id;
	protected $_time_created;
	protected $_time_sendbox;
	protected $_time_depart;
	protected $_time_arrive;
	protected $_time_recbox;
	
	public function __construct(array $options = null)
	{
		if (is_array($options)) {
			$this->setOptions($options);
		}
	}
	
	public function __set($name, $value)
	{
		$method = 'set' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid subscribe property');
		}
		$this->$method($value);
	}
	
	public function __get($name)
	{
		$method = 'get' . $name;
		if (('mapper' == $name) || !method_exists($this, $method)) {
			throw new Exception('Invalid subscribe property');
		}
		return $this->$method();
	}
	
	public function setOptions(array $options)
	{
		$methods = get_class_methods($this);
		foreach ($options as $key => $value) {
			$method = 'set' . ucfirst($key);
			if (in_array($method, $methods)) {
				$this->$method($value);
			}
		}
		return $this;
	}
	
	public function setId($id)
	{
		$this->_id = (int) $id;
		return $this;
	}
	
	public function getId()
	{
		return $this->_id;
	}
	
	public function setSenderName($sname){
		$this->_sender_name = (string) $sname;
		return $this;
	}
	
	public function getSenderName(){
		return $this->_sender_name;
	}
	public function setSenderId($sid){
		$this->_sender_id = (int) $sid;
		return $this;
	}
	
	public function getSenderId(){
		return $this->_sender_id;
	}
	
	public function setSenderTel($stel){
		$this->_sender_tel = (string) $stel;
		return $this;
	}
	
	public function getSenderTel(){
		return $this->_sender_tel;
	}
	
	public function setSenderAddrId($saddr){
		$this->_sender_addrid = (string) $saddr;
		return $this;
	}
	
	public function getSenderAddrId(){
		return $this->_sender_addrid;
	}
	
	public function setRecipient($rc){
		$this->_recipient = (string) $rc;
		return $this;
	}
	
	public function getRecipient(){
		return $this->_recipient;
	}
	
	public function setRecTel($rctel){
		$this->_rec_tel = (string) $rctel;
		return $this;
	}
	
	public function getRecTel(){
		return $this->_rec_tel;
	}
	
	public function setRecEmail($rec_email){
		$this->_rec_email = (string)$rec_email;
		return $this;
	}
	
	public function getRecEmail(){
		return $this->_rec_email;
	}
	
	public function setRecAddrId($rcaddr){
		$this->_rec_addrid = (string) $rcaddr;
		return $this;
	}
	
	public function getRecAddrId(){
		return $this->_rec_addrid;
	}
	
	public function setBarcodeId($barid){
		$this->_barcodeid = (string) $barid;
		return $this;
	}
	
	public function getBarcodeId(){
		return $this->_barcodeid;
	}
	
	public function setSubOrderId($sorderid){
		$this->_sub_orderid = (int) $sorderid;
		return $this;
	}
	
	public function getSubOrderId(){
		return $this->_sub_orderid;
	}
	
	public function setSendUnitId($suid){
		$this->_send_unitid = (int) $suid;
		return $this;
	}
	
	public function getSendUnitId(){
		return $this->_send_unitid;
	}
	
	public function setRecUnitId($rcuid){
		$this->_rec_unitid = (int) $rcuid;
		return $this;
	}
	
	public function getRecUnitId(){
		return $this->_rec_unitid;
	}
	
	public function setSendCourierId($send_cid){
		$this->_send_courierid = (int) $send_cid;
		return $this;
	}
	
	public function getSendCourierId(){
		return $this->_send_courierid;
	}
	
	public function setRecCourierId($rec_cid){
		$this->_rec_courierid = (int) $rec_cid;
		return $this;
	}
	
	public function getRecCourierId(){
		return $this->_rec_courierid;
	}
	
	public function setIfPayNow($ifpaynow){
		$this->_if_pay_now = (boolean) $ifpaynow;
		return $this;
	}
	
	public function getIfPayNow(){
		return $this->_if_pay_now;
	}
	
	public function setPayType($ptype){
		$this->_pay_type = (string) $ptype;
		return $this;
	}
	
	public function getPayType(){
		return $this->_pay_type;
	}
	
	public function setFee($fee){
		$this->_fee = (double)$fee;
		return $this;
	}
	
	public function getFee(){
		return $this->_fee;
	}
	
	public function setSubStatus($sub_stat){
		$this->_sub_status = (string) $sub_stat;
		return $this;
	}
	
	public function getSubStatus(){
		return $this->_sub_status;
	}
	
	public function setRemark($remark){
		$this->_remark = (string)$remark;
		return $this;
	}
	
	public function getRemark(){
		return $this->_remark;
	}
	
	public function setSizeId($sizeid){
		$this->_size_id = (int) $sizeid;
		return $this;
	}
	
	public function getSizeId(){
		return $this->_size_id;
	}
	
	public function setTimeCreated($created){
		$this->_time_created = (string) $created;
		return $this;
	}
	
	public function getTimeCreated(){
		return $this->_time_created;
	}
	
	public function setTimeSendbox($time){
		$this->_time_sendbox = (string) $time;
		return $this;
	}
	
	public function getTimeSendbox(){
		return $this->_time_sendbox;
	}
	
	public function setTimeDepart($depart){
		$this->_time_depart = (string) $depart;
		return $this;
	}
	
	public function getTimeDepart(){
		return $this->_time_depart;
	}
	
	public function setTimeArrive($arrive){
		$this->_time_arrive = (string) $arrive;
		return $this;
	}
	
	public function getTimeArrive(){
		return $this->_time_arrive;
	}
	
	public function setTimeRecbox($time){
		$this->_time_recbox = (string) $time;
		return $this;
	}
	
	public function getTimeRecbox(){
		return $this->_time_recbox;
	}
	
	

	
	



}

